<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>安全设置 - 智慧题库</title>
    <link href="../assets/css/tailwind.css" rel="stylesheet">
    <link href="../assets/css/font-awesome.min.css" rel="stylesheet">
</head>
<body class="font-inter bg-gray-50 min-h-screen flex flex-col bg-education">
    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white/90 backdrop-blur-sm shadow-sm transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <div class="flex items-center space-x-2">
                <div class="w-10 h-10 bg-primary/10 rounded-xl flex items-center justify-center text-primary">
                    <i class="fa fa-question-circle"></i>
                </div>
                <h1 class="text-xl font-bold text-dark ml-0 md:ml-[-2rem]">智慧题库管理系统</h1>
            </div>
            <!-- 顶部导航 -->
            <div class="hidden md:flex items-center space-x-2">
                <a href="AdminDashboard.html" class="nav-item">
                    <i class="fa fa-home mr-2"></i> 控制面板
                </a>
                <a href="QuestionManagement.html" class="nav-item">
                    <i class="fa fa-book mr-2"></i> 题库管理
                </a>
                <a href="ExamManagement.html" class="nav-item">
                    <i class="fa fa-graduation-cap mr-2"></i> 考试管理
                </a>
                <a href="TextbookVersionList.html" class="nav-item">
                    <i class="fa fa-archive mr-2"></i> 教材管理
                </a>
                <a href="StatisticsAnalysis.html" class="nav-item">
                    <i class="fa fa-bar-chart mr-2"></i> 数据分析
                </a>
                <a href="SystemSettings.html" class="nav-item active">
                    <i class="fa fa-cog mr-2"></i> 系统设置
                </a>
            </div>
            <div class="flex items-center space-x-4">
                <button class="p-2 text-muted hover:text-primary transition-colors relative">
                    <i class="fa fa-bell"></i>
                    <span class="absolute top-1 right-1 w-2 h-2 bg-accent rounded-full"></span>
                </button>
                <div class="flex items-center space-x-2">
                    <img src="https://picsum.photos/id/64/40/40" alt="用户头像" class="w-8 h-8 rounded-full object-cover border-2 border-primary/20">
                    <span class="hidden md:inline text-sm font-medium text-dark">张老师</span>
                    <i class="fa fa-angle-down text-muted"></i>
                </div>
                <button class="md:hidden p-2 text-muted hover:text-primary transition-colors" id="mobile-menu-button">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>
    <!-- 主内容区 -->
    <main class="flex-grow flex">
        <!-- 左侧导航栏 -->
        <aside id="sidebar" class="w-64 bg-sidebar-bg shadow-sidebar transition-all duration-300 h-[calc(100vh-64px)] sticky top-[64px] overflow-y-auto">
            <!-- 系统设置菜单 -->
            <div class="p-4 border-b border-gray-200">
                <h3 class="text-lg font-bold text-center text-muted uppercase tracking-wider">系统设置</h3>
            </div>
            <div class="p-2">
                <a href="SiteSettings.html" class="sidebar-item">
                    <i class="fa fa-globe"></i>
                    <span>站点设置</span>
                </a>
                <a href="RegisterSettings.html" class="sidebar-item">
                    <i class="fa fa-user-plus"></i>
                    <span>注册设置</span>
                </a>
                <a href="BasicSettings.html" class="sidebar-item">
                    <i class="fa fa-cog"></i>
                    <span>基础设置</span>
                </a>
                <div class="sidebar-item active">
                    <i class="fa fa-shield"></i>
                    <span>安全设置</span>
                </div>
                <a href="RolePermissions.html" class="sidebar-item">
                    <i class="fa fa-users"></i>
                    <span>角色权限</span>
                </a>
                <a href="DataBackup.html" class="sidebar-item">
                    <i class="fa fa-database"></i>
                    <span>数据备份</span>
                </a>
            </div>
        </aside>
        <!-- 内容区域 -->
        <div class="flex-grow p-6">
            <!-- 页面标题 -->
            <div class="mb-8">
                <div class="flex items-center justify-between">
                    <div>
                        <h2 class="text-[clamp(1.5rem,3vw,2rem)] font-bold text-dark">安全设置</h2>
                        <p class="text-muted mt-2">配置系统安全策略和登录规则</p>
                    </div>
                    <div class="flex space-x-3">
                        <button class="px-4 py-2 bg-white border border-gray-300 text-dark rounded-lg shadow-sm hover:bg-gray-50 transition-colors">
                            <i class="fa fa-eye mr-2"></i>预览
                        </button>
                        <button class="px-4 py-2 bg-primary text-white rounded-lg shadow-sm hover:bg-primary/90 transition-colors">
                            <i class="fa fa-save mr-2"></i>保存设置
                        </button>
                    </div>
                </div>
            </div>
            <!-- 后续分段写入表单内容 -->
            <!-- 密码策略 -->
            <div class="bg-white rounded-2xl p-6 shadow-card mb-6">
                <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                    <i class="fa fa-lock text-primary mr-2"></i>密码策略
                </h3>
                <div class="space-y-6">
                    <div class="flex items-center justify-between">
                        <div>
                            <label class="block text-sm font-medium text-muted mb-1">强密码要求</label>
                            <p class="text-xs text-muted">密码需包含大写字母、小写字母、数字和特殊字符</p>
                        </div>
                        <label class="relative inline-flex items-center cursor-pointer">
                            <input type="checkbox" checked class="sr-only peer">
                            <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary"></div>
                        </label>
                    </div>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div>
                            <label class="block text-sm font-medium text-muted mb-1">最小密码长度</label>
                            <input type="number" value="8" min="6" max="32" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-muted mb-1">密码有效期（天）</label>
                            <input type="number" value="90" min="0" max="365" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                        </div>
                    </div>
                </div>
            </div>
            <!-- 登录策略 -->
            <div class="bg-white rounded-2xl p-6 shadow-card mb-6">
                <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                    <i class="fa fa-sign-in text-primary mr-2"></i>登录策略
                </h3>
                <div class="space-y-6">
                    <div class="flex items-center justify-between">
                        <div>
                            <label class="block text-sm font-medium text-muted mb-1">登录验证码</label>
                            <p class="text-xs text-muted">登录时需输入验证码</p>
                        </div>
                        <label class="relative inline-flex items-center cursor-pointer">
                            <input type="checkbox" checked class="sr-only peer">
                            <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary"></div>
                        </label>
                    </div>
                    <div class="flex items-center justify-between">
                        <div>
                            <label class="block text-sm font-medium text-muted mb-1">登录失败锁定</label>
                            <p class="text-xs text-muted">连续输错密码5次，账号锁定10分钟</p>
                        </div>
                        <label class="relative inline-flex items-center cursor-pointer">
                            <input type="checkbox" checked class="sr-only peer">
                            <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary"></div>
                        </label>
                    </div>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div>
                            <label class="block text-sm font-medium text-muted mb-1">允许的登录方式</label>
                            <select multiple class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                <option selected>账号密码</option>
                                <option>手机号验证码</option>
                                <option>邮箱验证码</option>
                                <option>微信扫码</option>
                            </select>
                        </div>
                        <div>
                            <label class="block text-sm font-medium text-muted mb-1">登录通知</label>
                            <select class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                <option selected>仅异常登录通知</option>
                                <option>每次登录都通知</option>
                                <option>不通知</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <!-- IP策略 -->
            <div class="bg-white rounded-2xl p-6 shadow-card mb-6">
                <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                    <i class="fa fa-map-marker text-primary mr-2"></i>IP策略
                </h3>
                <div class="space-y-6">
                    <div class="flex items-center justify-between">
                        <div>
                            <label class="block text-sm font-medium text-muted mb-1">启用IP限制</label>
                            <p class="text-xs text-muted">仅允许指定IP段访问后台</p>
                        </div>
                        <label class="relative inline-flex items-center cursor-pointer">
                            <input type="checkbox" class="sr-only peer">
                            <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary"></div>
                        </label>
                    </div>
                    <div>
                        <label class="block text-sm font-medium text-muted mb-1">允许访问的IP段</label>
                        <textarea placeholder="如：192.168.1.0/24, 10.0.0.1" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50" rows="3"></textarea>
                    </div>
                </div>
            </div>
            <!-- 安全文档 -->
            <div class="bg-white rounded-2xl p-6 shadow-card mb-6">
                <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                    <i class="fa fa-file-text-o text-primary mr-2"></i>安全文档
                </h3>
                <div class="space-y-6">
                    <div>
                        <label class="block text-sm font-medium text-muted mb-1">安全策略文档</label>
                        <div class="border-2 border-dashed border-gray-300 rounded-lg p-4 text-center">
                            <i class="fa fa-file-pdf-o text-3xl text-muted mb-2"></i>
                            <p class="text-sm text-muted mb-2">上传安全策略PDF文件</p>
                            <button class="px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors">
                                <i class="fa fa-upload mr-2"></i>选择文件
                            </button>
                        </div>
                    </div>
                    <div>
                        <label class="block text-sm font-medium text-muted mb-1">安全提示</label>
                        <textarea placeholder="请输入安全提示内容..." class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50" rows="4">建议定期修改密码，勿将密码告知他人，发现异常请及时联系管理员。</textarea>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <!-- JavaScript -->
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 移动端菜单切换
            const mobileMenuButton = document.getElementById('mobile-menu-button');
            const sidebar = document.getElementById('sidebar');
            if (mobileMenuButton && sidebar) {
                mobileMenuButton.addEventListener('click', function() {
                    sidebar.classList.toggle('translate-x-0');
                    sidebar.classList.toggle('-translate-x-full');
                });
            }
            function checkScreenSize() {
                if (window.innerWidth < 768) {
                    sidebar.classList.add('-translate-x-full');
                    sidebar.classList.remove('translate-x-0');
                } else {
                    sidebar.classList.remove('-translate-x-full');
                    sidebar.classList.add('translate-x-0');
                }
            }
            checkScreenSize();
            window.addEventListener('resize', checkScreenSize);
        });
    </script>
</body>
</html> 